<?php
/**
 * Created by PhpStorm.
 * User: Admin
 * Date: 2018/7/17
 * Time: 22:48
 */
$router->group(['prefix' => 'public', 'namespace' => 'Common'], function () use ($router) {
    /**
     * 功能：PDF上传文件
     * GET: /api/public/uploadFiles
     * 控制器位置: app\Http\Controller\Common\FileUploadController.php
     */
    $router->post('/uploadFiles', 'FileUploadController@uploadFile');
    /**
     * 功能：Excel上传文件
     * POST: /api/public/uploadExcel
     * 控制器位置: app\Http\Controller\Common\DownLoadController.php
     */
    $router->post('/uploadExcel', 'FileUploadController@uploadExcel');
    /**
     * 功能：文件下載
     * POST: /api/public/download
     * 控制器位置: app\Http\Controller\Common\DownLoadController.php
     */
    $router->get('/download', 'DownLoadController@download');
    $router->get('/download1', 'DownLoadController@download1');
     /**
      * 功能：议题下载
      * POST: /api/public/downloadIssueFile
      * 控制器位置: app\Http\Controller\Common\DownLoadController.php
      */
    $router->get('/downloadIssueFile', 'DownLoadController@downloadIssueFile');
    /**
     * 功能：议题下载
     * POST: /api/public/downloadIssue
     * 控制器位置: app\Http\Controller\Common\DownLoadController.php
     */
    $router->get('/downloadIssue', 'DownLoadController@downloadIssue');
    /**
     * 功能：议题下载
     * POST: /api/public/downloadIssueFront
     * 控制器位置: app\Http\Controller\Common\DownLoadController.php
     */
    $router->get('/downloadIssueFront', 'DownLoadController@downloadIssueFront');

    /**
     * 公共配置
     * 控制器位置: app\Http\Controller\Common\ConfigsController.php
     */
    $router->group(['prefix' => 'config', 'namespace' => 'Config'], function () use ($router) {
        /**
         * 获取配置
         * POST: /api/public/config
         */
        $router->post('/', 'ConfigsController@select');
        /**
         * 获取配置
         * POST: /api/public/config/selectOnce
         */
        $router->post('/selectOnce', 'ConfigsController@selectOnce');
    });
    /**
     * 功能：base上传图片文件
     * GET: /api/public/baseUpload
     * 控制器位置: app\Http\Controller\Common\Base64UploadController.php
     */
    $router->post('/base64Upload', 'Base64UploadController@base64Upload');

    /**
     * 功能：file上传图片文件
     * GET: /api/public/fileUpload
     * 控制器位置: app\Http\Controller\Common\FileUploadController.php
     */
    $router->post('/file/upload', 'FileUploadController@upload');
    $router->post('/fileUpload', 'FileUploadController@upload');
    $router->post('file', 'FileUploadController@file');
    /**
     * 功能：ueditorUploadfile上传图片文件
     * GET: /api/public/ueditorUpload
     * 控制器位置: app\Http\Controller\Common\FileUploadController.php
     */
    $router->get('/ueditorUpload', 'FileUploadController@ueditorUpload');

    /**
     *
     */
    $router->group(['prefix' => 'ueditor', 'namespace' => 'UEditor'], function () use ($router) {
        /**
         * 获取配置
         * POST: /api/public/ueditor/upload
         */
        $router->get('/upload', 'UEditorController@upload');
        /**
         * 获取配置
         * POST: /api/public/ueditor/upload
         */
        $router->post('/upload', 'UEditorController@upload');
    });
    $router->group(['prefix' => 'code'], function () use ($router) {
        /**
         * 功能：生成验证码
         * 访问地址: POST: /api/public/code/getImgCode
         * 控制器位置: app\Http\Controller\Common\CaptchaController.php
         */
        $router->post('getImgCode', 'CaptchaController@getImgCode');
        /**
         * 功能：验证验证码
         * 访问地址: POST: /api/public/code/checkCode
         * 控制器位置: app\Http\Controller\Common\CaptchaController.php
         */
        $router->post('checkCode', 'CaptchaController@checkCode');
    });
});
